package com.liuwa.knowledge.domain;

import com.liuwa.common.annotation.Dict;
import com.liuwa.common.annotation.Excel;
import com.liuwa.common.constant.Subject;
import com.liuwa.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 教材对象 k_book
 * 
 * @author liuwa
 * @date 2025-04-03 10:06:25
 */
@Dict(name = "教材")
@ApiModel(description = "教材对象")
public class Book extends BaseEntity<Integer>{

    private static final long serialVersionUID = 1L;

    /** 类别 */
    @Excel(name = "类别", sort=0)
    @ApiModelProperty(name="type", required = true, value="类别")
    private Integer type;

    /** 名称 */
    @Excel(name = "名称", sort=10)
    @ApiModelProperty(name="name", required = true, value="名称")
    private String name;

    /** 封面 */
    @Excel(name = "封面", cellType = Excel.ColumnType.IMAGE, sort=20)
    @ApiModelProperty(name="cover", required = true, value="封面")
    private String cover;

    /** 学科 */
    @Excel(name = "学科", dictType = "subject", sort=30)
    @ApiModelProperty(name="subject", required = true, value="学科")
    private String subject;

    /** 出版社 */
    @Excel(name = "出版社", dictType = "sys_entity_publisher", sort=40)
    @ApiModelProperty(name="publisher", required = true, value="出版社")
    private String publisher;

    /** 年级 */
    @Excel(name = "年级", dictType = "grade", sort=50)
    @ApiModelProperty(name="grade", required = true, value="年级")
    private Integer grade;

    /** 上下册 */
    @Excel(name = "上下册", dictType = "volume", sort=60)
    @ApiModelProperty(name="volume", required = true, value="上下册")
    private String volume;

    public void setType(Integer type) 
    {
        this.type = type;
    }

    public Integer getType() 
    {
        return type;
    }

    public String getTypeLabel(){
        if(Publisher.FLTRP.equals(publisher) && Subject.ENGLISH.equals(subject)){
            if(type == 1){
                return "新标准一起";
            }
            else if(type == 3){
                return "新标准三起";
            }

        }

        return "";
    }
    

    public void setName(String name) 
    {
        this.name = name;
    }

    public String getName() 
    {
        return name;
    }
    

    public void setCover(String cover) 
    {
        this.cover = cover;
    }

    public String getCover() 
    {
        return cover;
    }
    

    public void setSubject(String subject) 
    {
        this.subject = subject;
    }

    public String getSubject() 
    {
        return subject;
    }
    

    public void setPublisher(String publisher) 
    {
        this.publisher = publisher;
    }

    public String getPublisher() 
    {
        return publisher;
    }
    

    public void setGrade(Integer grade) 
    {
        this.grade = grade;
    }

    public Integer getGrade() 
    {
        return grade;
    }
    

    public void setVolume(String volume) 
    {
        this.volume = volume;
    }

    public String getVolume() 
    {
        return volume;
    }
    



    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("type", getType())
            .append("name", getName())
            .append("cover", getCover())
            .append("subject", getSubject())
            .append("publisher", getPublisher())
            .append("grade", getGrade())
            .append("volume", getVolume())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("delFlag", getDelFlag())
            .toString();
    }
}
